package com.wt.admin.controller.sys;


import com.aizuda.easy.security.domain.Rep;
import com.wt.admin.config.aspect.annotation.LogAno;
import com.wt.admin.domain.entity.sys.SysSettingEntity;
import com.wt.admin.service.sys.SysSettingService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("setting")
public class SysSettingController {

    @Resource
    private SysSettingService sysSettingService;

    @LogAno(name = "查询设置")
    @PostMapping("find")
    public Rep<SysSettingEntity> findSetting(){
        return Rep.ok(sysSettingService.find(null));
    }

    @LogAno(name = "更新设置")
    @PostMapping("update")
    public Rep<SysSettingEntity> updateSetting(@RequestBody SysSettingEntity data){
        sysSettingService.edit(data);
        return Rep.ok();
    }


}
